<?php
namespace Views;

require_once('\Views\PageView.php');

class InstallView
{
	public $tryCreateDB = "tryCreateDB";
	private $_pv = null;
	
	public function __construct()
	{
		$this->_pv = new \Views\PageView();
	}
	
	public function getInstallForms()
	{
		$html = 
		"<form method='post'>
			<label for='".$this->_pv->userName."'>Användarnamn</label><br/>
			<input type='text' name='".$this->_pv->userName."' id='".$this->_pv->userName."' /><br/>
			<label for='".$this->_pv->firstName."'>Förnamn</label><br/>
			<input type='text' name='".$this->_pv->firstName."' id='".$this->_pv->firstName."' /><br/>
			<label for='".$this->_pv->lastName."'>Efternamn</label><br/>
			<input type='text' name='".$this->_pv->lastName."' id='".$this->_pv->lastName."' /><br/>
			<label for='".$this->_pv->email."'>E-post</label><br/>
			<input type='text' name='".$this->_pv->email."' id='".$this->_pv->email."' /><br/>
			<label for='".$this->_pv->password."'>Lösenord</label><br/>
			<input type='password' name='".$this->_pv->password."' id='".$this->_pv->password."' /><br/>
			<label for='".$this->_pv->repeatPassword."'>Repetera lösenord</label><br/>
			<input type='password' name='".$this->_pv->repeatPassword."' id='".$this->_pv->repeatPassword."' /><br/>
			<input type='submit' value='Installera' />
			<input type='hidden' name='".$this->tryCreateDB."' />
		</form>";
		
		return $html;
	}
	
	public function getContinueButton()
	{
		return "<input type='button' onClick='location.href=\"index.php\"' value='Starta!' />";
	}
	
	public function isCreatingDB()
	{
		if(isset($_POST[$this->tryCreateDB]))
			return true;
		else
			return false;
	}
}
?>